package com.ruge.common.util;

import com.ruge.system.pojo.vo.ActiveUser;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

/**
 * @author ：爱丽丝、如歌
 * @time ：2020/3/10  22:36
 * 描述 ：
 */
@Slf4j
public class ShiroUtil {
    public static ActiveUser getActiveUser() {
        //得到当前登陆的用户
        Subject subject = SecurityUtils.getSubject();
        ActiveUser activeUser = (ActiveUser) subject.getPrincipal();
        return activeUser;
    }

    public static Subject getSubject(){
        return SecurityUtils.getSubject();
    }
}
